public class Test {
    public static void main(String[] args) {
        MyThread1 myThread1 = new MyThread1();
        Thread thread  = new Thread(new MyRunnable1() {
        });
        Thread t1 = new Thread(() -> {
            System.out.println("使用 lambda 表达式...");
        });
        Thread t2 = new Thread() {
            @Override
            public void run() {
                System.out.println("继承 Thread, 重写 run, 使用匿名内部类...");
            }
        };
        Thread t3 = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("实现 Runnable, 重写 run, 使用匿名内部类...");
            }
        });

        //启动线程
        myThread1.start();
        thread.start();
        t1.start();
        t2.start();
        t3.start();
    }
}
class MyThread1 extends Thread {
    @Override
    public void run() {
        System.out.println("继承 Thread, 重写 run...");
    }
}
class MyRunnable1 implements Runnable {

    @Override
    public void run() {
        System.out.println("实现 MyRunnable1, 重写 run...");
    }
}
